<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Azure Container Apps Monitoring Question</title>
    <style>
        body {
            font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
            line-height: 1.6;
            margin: 0;
            padding: 20px;
            color: #333;
            max-width: 900px;
            margin: auto;
        }
        .question-container {
            background-color: #f8f9fa;
            border-radius: 8px;
            padding: 20px;
            margin-bottom: 20px;
        }
        table {
            width: 100%;
            border-collapse: collapse;
            margin: 20px 0;
        }
        th, td {
            padding: 12px;
            text-align: left;
            border-bottom: 1px solid #ddd;
        }
        th {
            background-color: #e9ecef;
        }
        select {
            width: 100%;
            padding: 8px;
            border-radius: 4px;
            border: 1px solid #ced4da;
        }
        button {
            background-color: #0078D4;
            color: white;
            padding: 10px 20px;
            border: none;
            border-radius: 4px;
            cursor: pointer;
            font-size: 16px;
        }
        button:hover {
            background-color: #106EBE;
        }
        #answer {
            display: none;
            margin-top: 20px;
            padding: 20px;
            background-color: #f9f9f9;
            border-radius: 8px;
        }
        .correct-answer {
            color: #107C10;
            font-weight: bold;
        }
        .explanation {
            margin-top: 15px;
        }
        .note {
            background-color: #fffde7;
            padding: 10px;
            border-left: 3px solid #ffd600;
            margin: 10px 0;
        }
        .correct {
            background-color: #e8f5e9;
            padding: 15px;
            border-left: 3px solid #4caf50;
            margin: 15px 0;
        }
    </style>
</head>
<body>
    <div class="question-container">
        <h2>QUESTION NO: 427 HOTSPOT</h2>
        
        <p>You are developing several microservices to run on Azure Container Apps.</p>
        <p>You need to monitor and diagnose the microservices.</p>
        <p>Which features should you use? To answer, select the appropriate feature in the answer area.</p>
        <p><strong>NOTE:</strong> Each correct selection is worth one point.</p>
        
        <table>
            <thead>
                <tr>
                    <th>Answer Area</th>
                    <th>Requirement</th>
                    <th>Feature</th>
                </tr>
            </thead>
            <tbody>
                <tr>
                    <td></td>
                    <td>View console logs from a container in near-real-time</td>
                    <td>
                        <select id="log-streaming">
                            <option value="">Select an option</option>
                            <option value="Log streaming">Log streaming</option>
                            <option value="Container console">Container console</option>
                            <option value="Azure Monitor Log Analytics">Azure Monitor Log Analytics</option>
                            <option value="Azure Monitor metrics">Azure Monitor metrics</option>
                        </select>
                    </td>
                </tr>
                <tr>
                    <td></td>
                    <td>Debug the microservice from inside the container</td>
                    <td>
                        <select id="debug-container">
                            <option value="">Select an option</option>
                            <option value="Container console">Container console</option>
                            <option value="Azure Monitor metrics">Azure Monitor metrics</option>
                            <option value="Azure Monitor Log Analytics">Azure Monitor Log Analytics</option>
                            <option value="Azure Container Registry">Azure Container Registry</option>
                        </select>
                    </td>
                </tr>
            </tbody>
        </table>
    </div>
    
    <button onclick="showAnswer()">查看答案</button>
    
    <div id="answer">
        <h3 class="correct-answer">正确答案:</h3>
        
        <div class="correct">
            <table>
                <tr>
                    <th>Requirement</th>
                    <th>Correct Feature</th>
                    <th>Technical Explanation</th>
                </tr>
                <tr>
                    <td>View console logs from a container in near-real-time</td>
                    <td><strong>Log streaming</strong></td>
                    <td>Provides real-time streaming of container logs</td>
                </tr>
                <tr>
                    <td>Debug the microservice from inside the container</td>
                    <td><strong>Container console</strong></td>
                    <td>Allows direct access to container for debugging</td>
                </tr>
            </table>
        </div>

        <div class="explanation">
            <h4>技术说明:</h4>
            
            <div class="note">
                <p><strong>功能对比:</strong></p>
                <ul>
                    <li><b>Log streaming</b>: 实时查看容器日志，适合监控应用输出</li>
                    <li><b>Container console</b>: 提供容器内交互式shell，用于调试</li>
                    <li><b>Azure Monitor Log Analytics</b>: 用于历史日志分析和查询</li>
                    <li><b>Azure Container Registry</b>: 容器镜像存储，不直接用于监控</li>
                </ul>
            </div>

            <h4>Azure Container Apps 监控架构:</h4>
            <div style="background-color: #f5f5f5; padding: 15px; border-radius: 4px;">
                <p>1. <strong>Log Streaming</strong> → 通过Azure门户或CLI实时查看日志</p>
                <p>2. <strong>Container Console</strong> → 使用exec命令进入运行中的容器</p>
                <p>3. <strong>诊断流程</strong>: 实时日志 → 控制台调试 → 日志分析</p>
            </div>

            <div class="note">
                <p><strong>生产环境建议:</strong></p>
                <ol>
                    <li>开发阶段使用Log streaming和Container console进行调试</li>
                    <li>生产环境配置Azure Monitor进行长期日志存储和分析</li>
                    <li>结合Application Insights实现端到端监控</li>
                </ol>
            </div>
        </div>
    </div>
    
    <script>
        // 显示答案
        function showAnswer() {
            document.getElementById('answer').style.display = 'block';
            
            // 自动选择正确答案
            document.getElementById('log-streaming').value = 'Log streaming';
            document.getElementById('debug-container').value = 'Container console';
            
            window.scrollTo({
                top: document.getElementById('answer').offsetTop,
                behavior: 'smooth'
            });
        }
    </script>
</body>
</html>
